Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

expr: improve clarity and consistency of help #58

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

ChrisHines
Copy link
Contributor

Also fix some spelling errors.

Also fix some spelling errors.
@ChrisHines
Copy link
Contributor Author

While researching how goda's various expressions work I began to wonder if the test=1(X) expression has been made obsolete by the X:+test selector. I couldn't find a difference in behavior. If they are the same then I suggest also replacing the test=1(X) entry in the goda help expr docs with the selector syntax since that seems newer, more flexible, and more intuitive.

@egonelbre
Copy link
Member

Those are great fixes.

I do think that X:+test does make most common test=1 use-cases obsolete. So, I'm all for using the X:+test in the examples.

The main difference is that the "environment modifier" allows to simplify some cases. For example test=1(A + B - C) instead of A:+test + B:+test - C:+test.

@egonelbre egonelbre merged commit 5ed8193 into loov:master Mar 14, 2022
@ChrisHines ChrisHines deleted the expr-help branch March 14, 2022 15:23
@ChrisHines
Copy link
Contributor Author

The main difference is that the "environment modifier" allows to simplify some cases. For example test=1(A + B - C) instead of A:+test + B:+test - C:+test.

Interesting.

Curiously test=1(A + B) is similar to (A + B):+test, except the second form includes A.test and B.test, but not A [A.test] or B [B.test]. The first form includes those as well.

@egonelbre
Copy link
Member

egonelbre commented Mar 15, 2022

Good catch. I missed the A [A.test] and A_test [A.test] in detecting whether it's a test package. I added a fix that makes the behavior consistent.

Which does bring up an interesting question. Should they be considered as a test package, i.e. A.test and A [A.test]?

I guess it does make sense that tests=1(A) - A === A:test. I guess if there's a need to differentiate, it's possible to add a new selector.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants